﻿using System;
using DataLayer.Types;

namespace DataLayer
{
    public abstract class DataChangedEventArgs : EventArgs
    {
        public DataChangedEventArgs(IBaseRecord context)
        {
            if(context == null) throw new ArgumentNullException();

            Context = context;
        }

        public IBaseRecord Context { get; private set; }

        public abstract void Execute();
    }

    /// <summary>
    /// Event args for an object having been deleted.
    /// </summary>
    public class ObjectDeletedEventArgs : DataChangedEventArgs
    {
        public ObjectDeletedEventArgs(IBaseRecord context)
            : base(context)
        {
        }

        public override void Execute()
        {
            throw new NotImplementedException();
        }
    }

    /// <summary>
    /// Events args for a new object having been created.
    /// </summary>
    public class NewObjectEventArgs : DataChangedEventArgs
    {
        public NewObjectEventArgs(IBaseRecord context)
            : base(context)
        {
        }

        public override void Execute()
        {
            throw new NotImplementedException();
        }
    }

    /// <summary>
    /// Events args for an object having been updated.
    /// </summary>
    public class ObjectUpdatedEventArgs : DataChangedEventArgs
    {
        public ObjectUpdatedEventArgs(IBaseRecord context)
            : base(context)
        {
        }

        public override void Execute()
        {
            throw new NotImplementedException();
        }
    }
}